package com.jeework.modules.sys.config;

import com.jeework.common.persistence.interceptor.PaginationInterceptor;
import org.apache.shiro.spring.web.ShiroFilterFactoryBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;
import org.springframework.core.env.Environment;

import javax.servlet.Filter;


@Configuration
@ImportResource(locations= {"classpath:spring-context.xml","classpath:spring-context-shiro.xml"})
public class Config {
    //@Value("${page.pageSize}")
    //private String pageSize;

    //@Autowired
   // private ShiroFilterFactoryBean shiroFilter;

//    @Bean
//    public PaginationInterceptor interceptor() {
//        System.out.println(this.shiroFilter);
//        PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
//        paginationInterceptor.setProperties(null);
//        return paginationInterceptor;
//    }

/*    @Bean
    public FilterRegistrationBean authFilterRegistration() {
        FilterRegistrationBean registration = new FilterRegistrationBean(this.shiroFilter.getFilters().get("authc"));
        registration.addUrlPatterns("/*");
        registration.setName("shiroFilter");
        registration.setOrder(2);
        return registration;
    }*/
}
